package com.itheima.hmshopping.dubbo.apiImpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.hmshopping.dubbo.api.UmsAdminRoleRelationApi;
import com.itheima.hmshopping.dubbo.mapper.UmsAdminRoleRelationMapper;
import com.itheima.hmshopping.entity.UmsAdminRoleRelation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class UmsAdminRoleRelationImpl implements UmsAdminRoleRelationApi {
    @Autowired
    private UmsAdminRoleRelationMapper umsAdminRoleRelation;


    /**
     * 中间表,根据账号查看对应权限
     *
     * @param roleid
     * @return
     */
    @Override
    public UmsAdminRoleRelation selectId(Long roleid) {
        LambdaQueryWrapper<UmsAdminRoleRelation> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(UmsAdminRoleRelation::getAdminId,roleid);
        return umsAdminRoleRelation.selectOne(wrapper);
    }
}
